feat(core): project identity (data foundation for session library)#121
Closed
feat(core): project identity (data foundation for session library)#121
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace placeholder identity arg in syncFile with real computeIdentity() call backed by a new realFs adapter (existsSync/readFileSync/spawnSync). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR 1 of 7 in the Session Library redesign. Pure data-layer change with no UI changes.
git_remote → git_common_dir → manifest_path → loose → path(short-circuit priority)user_version 6:identity_kind/identity_keycolumns onprojects+ index, plusproject_groups_vview that aggregates same-identity rows across sourceslistProjectGroups()query for upcoming UI consumptionresolveProjectname for new sessionsSpec & plan
~/Documents/dev-docs/spool/session-library.md§4~/Documents/dev-docs/spool/plans/session-library-pr1.md~/Documents/dev-docs/spool/plans/session-library.mdFiles changed
11 commits, ~640 LOC net. Logical units: types → identity computation → display name util → migration v6 → query persistence → syncer wiring → backfill → groups query → e2e test → strict-tsc fix → final fixes (spawn timeout + portable test).
Test plan
pnpm --filter @spool-lab/core test— 73 passed (15 test files)pnpm --filter @spool-lab/core build— cleanpnpm build(Turbo, 3 packages) — clean/tmp/...short-circuits to loose, no real git spawn)Noteworthy / deferred
getOrCreateProjectdoes not refreshdisplay_nameon existing rows. Pre-existing pattern; identity columns are correctly set on insert. If a project'spackage.jsonnamefield changes after first index, the display name stays stale. Future PR can addON CONFLICT DO UPDATE.listProjectGroupsnot yet exported fromindex.ts. Intentional — UI consumes it in PR 3 (Library Shell + Sidebar). Public surface stays unchanged.spawnSynchas a 5s timeout. Mirrors the fix already applied in Spool Daemon to prevent hunggit configcalls (slow ssh-agent, network mounts) from blocking indexing.MIN(p.display_name)notCOALESCE(MIN(display_name), MIN(slug)). Equivalent in practice —display_nameisNOT NULL.What this PR does NOT do
Per the master PR sequence:
The new
project_groups_vview is built but unused by the UI — by design.